<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>设置 - 会员中心 -  {:C('UU_SITE_NAME')}</title>
<link href="__ROOT__/{:C('UU_TPL_DIR')}/public/css/user.css" rel="stylesheet" type="text/css">
<include file="public:header" />
<div class="usermain">
  <div class="mleft">
<include file="left_nav" />
  </div>
  
  <div class="mright">
  
    
	
    <div class="mbox">
	  	<div class="utopt">
			  <div class="tit">账号设置</div>
			<include file="set_nav" />
			<div class="clear"></div>
	  </div>
	  
	  
        <div class="user_form_tit">
		<h2>修改密码</h2>
		</div>
		
		
     <form action="?" method="post" id="J_user_pwd_edit">
	 <div class="setpwd">
	   <div class="formli"> 
	     <div class="input_text_inside t3">
	       <div class="inputtit">旧密码：</div>
        <input name="old_password" type="password"  class="minput" id="ajax_edit_username_input"   maxlength="30"/>
          </div>
        </div>
	   <div class="formli">
	     <div class="input_text_inside t3">
	       <div class="inputtit">新密码：</div>
        <input name="password" type="password"  class="minput"     maxlength="30"/>
          </div>
        </div>
	   <div class="formli">
	     <div class="input_text_inside t5">
	       <div class="inputtit">确认新密码：</div>
        <input name="password1" type="password"  class="minput"     maxlength="30"/>
          </div>
        </div>
		<div class="formli">
		<input name="" type="submit"  value="保存密码" class="btn_blue btn_border btn_inline_medium" id="J_save">
		</div>
	    
		</div>
		</form>
        
		
		
    </div>
  </div>
   <div class="clear"></div>
</div>
<include file="public:footer" />
<script type="text/javascript">
$(document).ready(function()
{
$("#J_user_pwd_edit").submit( function () {
 
	old_password=$("#J_user_pwd_edit input[name=old_password]").val();
	password=$("#J_user_pwd_edit input[name=password]").val();
	password1=$("#J_user_pwd_edit input[name=password1]").val();
  if (old_password==''){
  	disapperTooltip("remind","旧密码不能为空");
	return false;
  }
  if (password==''){
  	disapperTooltip("remind","新密码不能为空");
	return false;
  }
  if (password.length<6 || password.length>18){
  	disapperTooltip("remind","密码长度必须是6-18位字符");
	return false;
  }
   if (password!=password1){
  	disapperTooltip("remind","两次输入的密码不相同");
	return false;
  }
  else
  {
  		$("#J_save").val('提交中...').attr("disabled","disabled");
		 $.getJSON(ajaxURL, {act: "ajax_user_editpwd",old_password:old_password,password:password}, function(json){
			if (json.status==0){
				
				$("#J_save").val('保存密码').removeAttr("disabled");
				disapperTooltip("remind",json.content);
			}else if (json.status==1){
				//window.location.reload();
				$("#J_user_pwd_edit input[type=password]").val('')
				$("#J_save").val('保存密码').removeAttr("disabled");
				disapperTooltip("success",json.content);
			}else{
				$("#J_save").val('保存密码').removeAttr("disabled");
				disapperTooltip("remind","未知错误");
			}
		});
  		
  }
  return false;
} );

});
</script>
</body>
</html>
